<#import "/common/taglibs/spring.ftl" as spring/>
<#macro switchButton inputName on=false onValue="true" offValue="false">
<span class="m-switch m-switch--icon">
    <label>
        <input type="checkbox" data-on-value="${onValue}" data-off-value="${offValue}" ${on?string('checked','')} onclick='var checked = $(this).prop("checked"); var value = $(this).data(checked?"onValue":"offValue");$(this).next("input").val(value)'>
        <input type="text" name="${inputName}" >
        <span></span>
    </label>
</span>
</#macro>